/**
 * @file io_configure.h
 * @brief this is a brief description
 * @details this is the detail description.
 * @author fulong 
 * @data 6/26/2014
 * @version 1.0
 * @par Copyright (c):
 * @par First build
 *     version: fulong 
 *     data: 6/26/2014
 */
#ifndef __IO_CONFIGURE_H__
#define __IO_CONFIGURE_H__
#include "../hal_include/hal_types.h"

#ifdef __R8C
    #define BV(pin) (1<<(pin))

    #define set_output(port,pin) {if(port==0)prc2=1;pd##port |=BV(pin);}
    #define set_input(port,pin) {if(port==0)prc2=1;pd##port &=~BV(pin);}

    #define set_output_value(port,pin) {p##port |=BV(pin);}
    #define clr_output_value(port,pin) {p##port &=~BV(pin);}
#endif
#ifdef __STM32
typedef enum {
    PORTA,
    PORTB,
    PORTC,
    PORTD,
    PORTE,
    PORTF
}stm32_port_defined;
extern void set_output(uint8 port,uint8 mode, uint8 pin);
extern void set_input(uint8 port,uint8 mode,uint8 pin);
#endif
#endif /* __IO_CONFIGURE_H__ */
